//异常捕获


let fs = require("fs");
let fileInfo;
try {
	//预测可能会出现问题的代码，如果者却就不执行catch的代码
	fileInfo = fs.statSync("b.txt");
} catch(error) {
	//接收到了错误，会执行这一段代码
	   fs.writeFileSync("b.txt","我是内容",{flag:"a"})
}
fs.readFile("b.txt",{encoding:"utf-8"},(err,data)=>{
	console.log(data);
})